home *** CD-ROM | disk | FTP | other *** search
- Path: newsbf02.news.aol.com!not-for-mail
- From: maddawson@aol.com (MADDawson)
- Newsgroups: comp.lang.c
- Subject: FLOATING POINT PROBLEM
- Date: 1 Apr 1996 06:30:23 -0500
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: root@newsbf02.news.aol.com
- Message-ID: <4joeof$hoc@newsbf02.news.aol.com>
- Reply-To: maddawson@aol.com (MADDawson)
- NNTP-Posting-Host: newsbf02.mail.aol.com
-
- I have been working on a Windows program. The prog compiles correctly
- without any warnings or errors. When I add something that tries to get a
- float value from a string, the program quits running. It does this in and
- out of the IDE.
-
- I have erased the project and copied a project from another program and I
- get the same results. I have re-created the project from scratch and
- still no luck.
-
- I have included every .h file I would think would have something to do
- with it. I would REALLY appreciate some help with this as I have compiled
- a similar program correctly and have not had this problem before. I would
- think it might be a compiler setting or something NOT in the program
- itself.
-
- I have included the following lines.
-
- float part_number;
- char buffer[100];
-
- I get the value of the edit control using GetDlgItemText and put into
- buffer. (This works as I have a MessageBox that shows the value.
-
- Then I try:
-
- part_number = atof(buffer);
-
- This is where the prog stops.
-
- I have also tried:
-
- sscanf(buffer, "%f", &part_number);
-
- It stops here, too. (I have used this line in another prog and it works
- correctly.
-
- Again, I would really appreciate any help I receive on this.
-
- Thanks
- MAD
- maddawson@aol.com
- MADDawson@aol.com
- Project Engineer @ Kimball International
-